home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / include / libgimp / gimpsizeentry.h.z / gimpsizeentry.h
Encoding:
C/C++ Source or Header  |  2002-07-08  |  5.0 KB  |  149 lines

  1. /* LIBGIMP - The GIMP Library       
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball 
  3.  *
  4.  * gimpsizeentry.h
  5.  * Copyright (C) 1999-2000 Sven Neumann <sven@gimp.org>
  6.  *                         Michael Natterer <mitch@gimp.org> 
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Lesser General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Lesser General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Lesser General Public
  19.  * License along with this library; if not, write to the
  20.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  * Boston, MA 02111-1307, USA.
  22.  */
  23.  
  24. #ifndef __GIMP_SIZE_ENTRY_H__
  25. #define __GIMP_SIZE_ENTRY_H__
  26.  
  27. #include <libgimp/gimpunit.h>
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /* For information look into the C source or the html documentation */
  34.  
  35.  
  36. #define GIMP_TYPE_SIZE_ENTRY            (gimp_size_entry_get_type ())
  37. #define GIMP_SIZE_ENTRY(obj)            (GTK_CHECK_CAST ((obj), GIMP_TYPE_SIZE_ENTRY, GimpSizeEntry))
  38. #define GIMP_SIZE_ENTRY_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SIZE_ENTRY, GimpSizeEntryClass))
  39. #define GIMP_IS_SIZE_ENTRY(obj)         (GTK_CHECK_TYPE (obj, GIMP_TYPE_SIZE_ENTRY))
  40. #define GIMP_IS_SIZE_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SIZE_ENTRY))
  41.  
  42. typedef struct _GimpSizeEntry       GimpSizeEntry;
  43. typedef struct _GimpSizeEntryClass  GimpSizeEntryClass;
  44.  
  45. typedef enum
  46. {
  47.   GIMP_SIZE_ENTRY_UPDATE_NONE       = 0,
  48.   GIMP_SIZE_ENTRY_UPDATE_SIZE       = 1,
  49.   GIMP_SIZE_ENTRY_UPDATE_RESOLUTION = 2
  50. } GimpSizeEntryUpdatePolicy;
  51.  
  52. typedef struct _GimpSizeEntryField  GimpSizeEntryField;
  53.  
  54. struct _GimpSizeEntry
  55. {
  56.   GtkTable   table;
  57.  
  58.   GSList    *fields;
  59.   gint       number_of_fields;
  60.  
  61.   GtkWidget *unitmenu;
  62.   GimpUnit   unit;
  63.   gboolean   menu_show_pixels;
  64.   gboolean   menu_show_percent;
  65.  
  66.   gboolean                   show_refval;
  67.   GimpSizeEntryUpdatePolicy  update_policy;
  68. };
  69.  
  70. struct _GimpSizeEntryClass
  71. {
  72.   GtkTableClass parent_class;
  73.  
  74.   void (* value_changed)  (GimpSizeEntry *gse);
  75.   void (* refval_changed) (GimpSizeEntry *gse);
  76.   void (* unit_changed)   (GimpSizeEntry *gse);
  77. };
  78.  
  79. /* For information look into the C source or the html documentation */
  80.  
  81. GtkType     gimp_size_entry_get_type (void);
  82.  
  83. GtkWidget * gimp_size_entry_new (gint                       number_of_fields,
  84.                  GimpUnit                   unit,
  85.                  const gchar               *unit_format,
  86.                  gboolean                   menu_show_pixels,
  87.                  gboolean                   menu_show_percent,
  88.                  gboolean                   show_refval,
  89.                  gint                       spinbutton_usize,
  90.                  GimpSizeEntryUpdatePolicy  update_policy);
  91.  
  92. void        gimp_size_entry_add_field  (GimpSizeEntry   *gse,
  93.                     GtkSpinButton   *value_spinbutton,
  94.                     GtkSpinButton   *refval_spinbutton);
  95.  
  96. void        gimp_size_entry_attach_label          (GimpSizeEntry *gse,
  97.                            const gchar   *text,
  98.                            gint           row,
  99.                            gint           column,
  100.                            gfloat         alignment);
  101.  
  102. void        gimp_size_entry_set_resolution        (GimpSizeEntry *gse,
  103.                                gint           field,
  104.                                gdouble        resolution,
  105.                            gboolean       keep_size);
  106.  
  107. void        gimp_size_entry_set_size              (GimpSizeEntry *gse,
  108.                                gint           field,
  109.                                gdouble        lower,
  110.                            gdouble        upper);
  111.  
  112. void        gimp_size_entry_set_value_boundaries  (GimpSizeEntry *gse,
  113.                            gint           field,
  114.                            gdouble        lower,
  115.                            gdouble        upper);
  116.  
  117. gdouble     gimp_size_entry_get_value             (GimpSizeEntry *gse,
  118.                                gint           field);
  119. void        gimp_size_entry_set_value             (GimpSizeEntry *gse,
  120.                                gint           field,
  121.                                gdouble        value);
  122.  
  123. void        gimp_size_entry_set_refval_boundaries (GimpSizeEntry *gse,
  124.                            gint           field,
  125.                            gdouble        lower,
  126.                            gdouble        upper);
  127. void        gimp_size_entry_set_refval_digits     (GimpSizeEntry *gse,
  128.                                gint           field,
  129.                                gint           digits);
  130.  
  131. gdouble     gimp_size_entry_get_refval            (GimpSizeEntry *gse,
  132.                                gint           field);
  133. void        gimp_size_entry_set_refval            (GimpSizeEntry *gse,
  134.                                gint           field,
  135.                                gdouble        refval);
  136.  
  137. GimpUnit    gimp_size_entry_get_unit              (GimpSizeEntry *gse);
  138. void        gimp_size_entry_set_unit              (GimpSizeEntry *gse, 
  139.                                GimpUnit       unit);
  140.  
  141. void        gimp_size_entry_grab_focus            (GimpSizeEntry *gse);
  142.  
  143.  
  144. #ifdef __cplusplus
  145. }
  146. #endif /* __cplusplus */
  147.  
  148. #endif /* __GIMP_SIZE_ENTRY_H__ */
  149.